Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

True color support #1895

Merged
merged 25 commits into from
Apr 7, 2019
Merged

True color support #1895

merged 25 commits into from
Apr 7, 2019

Conversation

jerch
Copy link
Member

@jerch jerch commented Jan 13, 2019

PR to finally get true color support. Fixes #484.

Steps to get this done:

  • rewrite terminal attributes to support RGB
  • use new buffer layout
  • enhance DOM renderer to deal with RGB
  • enhance canvas renderer to deal with RGB

With this PR xterm.js will support true color in the semicolon notation like CSI 38 ; 2 ; R ; G ; B m.
To be more in line with the spec the parser has to be extended to support the colon notation. It will not be covered with this PR.

This PR relies on #1878, most of the commit are from there. The true color changes start with commit c444eeb.

@jerch jerch added the work-in-progress Do not merge label Jan 13, 2019
@jerch
Copy link
Member Author

jerch commented Jan 13, 2019

DOM renderer has now RGB support.

  • without RGB
    grafik

  • with RGB
    grafik

@jerch
Copy link
Member Author

jerch commented Jan 14, 2019

For those that dont see the difference in the pictures above here some more juicy truicy colors in the demo (font-size 3, cols 300, rows 100):

grafik

@jerch
Copy link
Member Author

jerch commented Jan 14, 2019

@Tyriar I am not sure about the canvas renderer whether it should be applied there at all, since it is a drop candidate. Any thoughts on this?

@Tyriar
Copy link
Member

Tyriar commented Jan 14, 2019

@jerch 😍

I think we should, the canvas renderer will likely take months to phase out (iff there are no issues with webgl).

@jerch
Copy link
Member Author

jerch commented Jan 15, 2019

canvas renderer has now preliminary RGB support. This is only hacked in for now and bypasses the cache, several conditions like inverting fg/bg does not work yet.
The canvas renderer needs more rework to integrate this nicely, things like flags, fg and bg span several levels of method descents and need to be harmonized with the CellData type.

@jerch
Copy link
Member Author

jerch commented Jan 17, 2019

Transition of the canvas renderer is done. RGB is for now always uncached, not sure if we ever want to cache those, the sheer amount of colors will invalidate the cache entries often. Might still be worth to try since most use cases will still only use a small set of colors.
A minor optimization might be to allow cached drawing of palette foreground on RGB background, but we should test first if the possible glyph border artefacts are bearable.

Technically this PR is ready for review, but I think we should get the pending PRs it relies on done first. In the meantime I gonna cleanup the new code and do more tests. The latter is cumbersome since we have no automated canvas tests at all. Maybe we get something rolling with node-canvas?

@jerch jerch added type/enhancement Features or improvements to existing features area/renderer and removed work-in-progress Do not merge labels Jan 17, 2019
@jerch jerch self-assigned this Jan 17, 2019
@Tyriar
Copy link
Member

Tyriar commented Jan 26, 2019

@jerch some conflicts are stacking up on this one.

@jerch
Copy link
Member Author

jerch commented Jan 27, 2019

@Tyriar This was expected, its due to #1878 and the reflow changes, both conflict in buffer changes.

@Tyriar
Copy link
Member

Tyriar commented Apr 3, 2019

Fixed a lot of merge conflicts

Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/Types.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants